/**
 * Kohive.app.ChatController
 * @extends ExtMVC.Controller
 * Shows the chat window
 */
Kohive.app.ChatController = Ext.extend(Kohive.controllers.KohiveController, {
			name					: 'chat',
			title					: Ext.ux.Translator
					.translate('app_chat_room'),

			constructor				: function() {
				Kohive.app.ChatController.superclass.constructor.call(this, {
							viewsPackage	: Kohive.views.chat
						});

				var os = ExtMVC.OS.getOS();
				var controller = this;

				this.registerViews({
							'index'	: Kohive.views.chat.Index
						});

				/**
				 * @action index 
				 * Action description
				 */
				this.registerAction('index', function() {
							// Render the index window
							this.indexWindow = this.renderView('index', {});

							// Show the window
							this.indexWindow.show();
						});
			},

			/**
			 * @return {String} The channel name for the current hive
			 */
			currentHiveChannelName	: function() {
				return String.format("#KohiveHive--{0}", Kohive.OS
								.getCurrentHive().data.hive.irc_channel_id);
			}
		});

ExtMVC.OS.getOS().registerController('chat', Kohive.app.ChatController);
